import request from "@/utils/request";

export async function getUserResumesInfoById(id) {
    return await new request({
        url: `/api/user/resume/list/${id}`,
        method: "GET"
    })
}

export async function getUserResumeInfoByUserIdAndResumeId(id, resumeId) {
    return await new request({
        url: `/api/user/resume/info/${id}/${resumeId}`,
        method: "GET"
    })
}


export async function saveUserResumeInfo(data) {
    return await new request({
        url: `/api/user/resume`,
        method: "POST",
        data
    })
}

export async function modifyUserResumeInfo(data) {
    return await new request({
        url: `/api/user/resume`,
        method: "PUT",
        data
    })
}

export async function downloadUserResumeFileById(id){
    return await new request({
        url: `/api/user/resume/file/${id}`,
        method: "GET",
    })
}

export async function deleteUserOnlineResumeFileById(id){
    return await new request({
        url: `/api/user/resume/file/${id}`,
        method: "DELETE",
    })
}

export async function modifyOrSaveUserResumeEduExperienceInfo(data){
    return await new request({
        url: `/api/user/resume/eduOpera`,
        method: "POST",
        data
    })
}

export async function modifyOrSaveUserResumePraExperienceInfo(data){
    return await new request({
        url: `/api/user/resume/praOpera`,
        method: "POST",
        data
    })
}


export async function modifyOrSaveUserResumeProExperienceInfo(data){
    return await new request({
        url: `/api/user/resume/proOpera`,
        method: "POST",
        data
    })
}

export async function deleteEduExperienceById(id){
    return await new request({
        url: `/api/user/edu/remove/${id}`,
        method: "DELETE",
    })
}

export async function deletePraExperienceById(id){
    return await new request({
        url: `/api/user/pra/remove/${id}`,
        method: "DELETE",
    })
}

export async function deleteProExperienceById(id){
    return await new request({
        url: `/api/user/pro/remove/${id}`,
        method: "DELETE",
    })
}

export async function deleteUserResumeById(id){
    return await new request({
        url: `/api/user/resume/remove/${id}`,
        method: "DELETE",
    })
}

export async function modifyUserResumeHonorAward(data){
    return await new request({
        url: `/api/user/resume/honor/award/modify`,
        method: "POST",
        data
    })
}

export async function modifyUserResumeHobby(data){
    return await new request({
        url: `/api/user/resume/hobby/modify`,
        method: "POST",
        data
    })
}

export async function userDeliverResume(data) {
    return await new request({
        url: "/api/user/deliver/send",
        method: "POST",
        data
    })
}

export async function checkUserDeliveredResumeForCareer(data) {
    return await new request({
        url: `/api/user/deliver/check/${data.career_id}/${data.user_id}`,
        method: "GET",
    })
}
